﻿using Prism.Ioc;
using Prism.Modularity;
using Prism.Unity;
using prism_model1;
using prism_model2;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using wpf_prism.ViewModels;

namespace wpf_prism
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// 将原有的Application类换成PrismApplication类
    /// </summary>
    public partial class App : PrismApplication
    {



        /// <summary>
        /// 创建Shell
        /// </summary>
        /// <returns></returns>
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        /// <summary>
        /// 注册类型
        /// </summary>
        /// <param name="containerRegistry"></param>
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            // 注册视图和ViewModel等
            containerRegistry.RegisterForNavigation<MainWindow, MainWindowViewModel>();
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<Prism_model1Module>();
            moduleCatalog.AddModule<Prism_model2Module>();
        }

    }

}
